//
//  UITableView+RegisCell.m
//  StickyNote
//
//  Created by 索晓晓 on 2021/8/24.
//

#import "UITableView+RegisCell.h"

@implementation NSObject (StringClass)

+ (NSString *)classString {
    return NSStringFromClass(self.class);
}

@end

@implementation UITableView (RegisCell)

- (void)regisCellWithNibClass:(Class)cls {
    [self registerNib:[UINib nibWithNibName:NSStringFromClass(cls) bundle:[NSBundle bundleForClass:cls]] forCellReuseIdentifier:NSStringFromClass(cls)];
}
- (void)regisCellWithClass:(Class)cls {
    [self registerClass:cls forCellReuseIdentifier:NSStringFromClass(cls)];

}
@end

@implementation UICollectionView (RegisCell)

- (void)regisCellWithNibClass:(Class)cls {
    [self registerNib:[UINib nibWithNibName:NSStringFromClass(cls) bundle:[NSBundle bundleForClass:cls]] forCellWithReuseIdentifier:NSStringFromClass(cls)];
    
}

- (void)regisCellWithClass:(Class)cls {
    [self registerClass:cls forCellWithReuseIdentifier:NSStringFromClass(cls)];
}

@end
